package com.zy.sso.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/page")
// 用于浏览器访问页面跳转
public class PageController {

	@RequestMapping("/register")
	public String showRegister() {
		return "register";
	}

	// redirect 先将想去的url先保存起来，如果登陆成功，则跳转url，反之去首页界面（login.jsp完成）
	@RequestMapping("/login")
	public String showLogin(String redirect, Model model) {
		//login.jsp 需要接收判断redirect
		model.addAttribute("redirect", redirect);
		return "login";
	}
}
